mui.init({});


mui.plusReady(function(){
	loadDatas();
	
});



function loadDatas(){
	var self = plus.webview.currentWebview();
	var totalPeriod = self.totalPeriod;
	var title = self.title;
	var tenderMoney = self.tenderMoney;
	var rateYear = self.rateYear;
	var YMD = self.YMD;
	var paidPeriod = self.paidPeriod;
	
	$("#title1").html(title);
	$("#tenderMoney").html("￥"+tenderMoney)
	$("#rateYear").html(rateYear+"%")
	$("#YMD").html(YMD)
	$("#period").html(paidPeriod+"/"+totalPeriod)
}

function callback(data){	
	var repaymentMx = data.repaymentMx;
	if(typeof(repaymentMx) == 'undefined'){
		mui.alert("                         暂无记录!");
		return;
	}
	var htmlArr = [];
	for(var i=0,count=repaymentMx.length; i<count; i++){
		var repayment = repaymentMx[i];
		var html = getHtml(repayment);
		htmlArr[i] = html;
	}
	var htmlCodes = htmlArr.join("  ");
	$("#returnMoneyList-info").html(htmlCodes);

}

function getHtml(repayment){

	var hsrq = repayment.hsrq;
	var qs = translate(repayment.qs);
	
	var bj = repayment.bj;
	var lx = repayment.lx;
	var state = repayment.state;

var htmls = [
		'<table class="returnMoneyList-table" border="1">',
				'<tbody>',
					'<tr>',
						'<td class="qs_hsrq" >借标标号</td>',
						'<td class="bj" >￥'+bj+'</td>',
					'</tr>',
					'<tr>',
						'<td class="qs_hsrq" >投资金额</td>',
						'<td class="bj" >￥'+bj+'</td>',
					'</tr>',
					'<tr>',
						'<td class="qs_hsrq" >年化收益</td>',
						'<td class="bj" >￥'+bj+'</td>',
					'</tr>',
					'<tr>',
						'<td class="qs_hsrq" >投资日期</td>',
						'<td class="bj" >￥'+bj+'</td>',
					'</tr>',
					'<tr>',
						'<td class="qs_hsrq" >标的进度</td>',
						'<td class="bj" >￥'+bj+'</td>',
					'</tr>',
				'</tbody>',
			'</table>'
			];
	return htmls.join(" ");
}

